import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import OperationManagementView from "@/views/OperationManagementView.vue";

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/shoppingMall',
    children:[
      {path: '/shoppingMall', component: () => import('../views/shoppingMall/ShoppingMallView.vue')},
      {path: '/article', component: () => import('../views/article/ArticleView.vue')},
      {path: '/order', component: () => import('../views/order/OrderView.vue')},
      {path: 'Merchandise/', component: () => import('../views/merchandise/MerchandiseView.vue')}
        ]
  },
  {path: '/userLogin', component: () => import('../views/UserLoginView.vue')},

  {
    path: '/OMV',
    name: 'OMV',
    component: OperationManagementView,
    redirect:'/userOperation',
    children:[
      {path: '/userOperation', component: () => import('../views/Operation/UserOperation.vue')},
      {path: '/articleOperation', component: () => import('../views/Operation/ArticleOperation.vue')},
      {path: '/shoppingMallOperation', component: () => import('../views/Operation/ShoppingMallOperation.vue')},
      {path: '/orderOperation', component: () => import('../views/Operation/OrderOperation.vue')}
    ]
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
